subroutine r1ai_t1fn_inafi(r1, t1, iiabj,& 
               icore, fact)
!
use mod_ioff
use mod_orbit
implicit none
!
real*8, intent(in) :: fact
real*4, intent(in) :: r1(*)
real*4, intent(in) :: iiabj(*)
!
real*4, intent(inout) :: t1(*), icore(*)
!
integer :: i, j, a, b, nsize, nsizeaa, nsizebb
integer, external :: irpdso
real*8, external :: dnrm2, nrm2so
!this is to do r1(ai) = r1(ai) + t1(f,n)<na||fi>
!one should note that <na||fi> are sort as (fn,ai)
!==AA
call VmnpqVmnrs_to_Vpqrs(iiabj(ioi4(1)), t1(ifvo(1)), 1, 1, vrta, popa, 1, &
             vrta, popa, 1, zorb, zorb, 1, r1(ifvo(1)), 1, fact, 1.d0)
call VmnpqVmnrs_to_Vpqrs(iiabj(ioi4(6)), t1(ifvo(2)), 1, 1, vrtb, popb, 1, &
             vrta, popa, 1, zorb, zorb, 1, r1(ifvo(1)), 1, fact, 1.d0)
!==BB
call VmnpqVmnrs_to_Vpqrs(iiabj(ioi4(3)), t1(ifvo(2)), 1, 1, vrtb, popb, 1, &
             vrtb, popb, 1, zorb, zorb, 1, r1(ifvo(2)), 1, fact, 1.d0)
call VmnpqVmnrs_to_Vpqrs(iiabj(ioi4(5)), t1(ifvo(1)), 1, 1, vrta, popa, 1, &
             vrtb, popb, 1, zorb, zorb, 1, r1(ifvo(2)), 1, fact, 1.d0)
return
end
